<?php

namespace App\Http\Requests\Frontend\User;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;

class RelationRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'email' =>['required', 'string', 'email', 'max:255'],
            'type' => ['required', 'int'],
        ];
    }

    public function postFillData()
    {

        return [
            'email' =>$this->email,
            'type' => $this->type,
            'user_id' => Auth::id(),
            'created_at' => date('Y-m-d H:i:s',time()),
            'updated_at' => date('Y-m-d H:i:s',time()) ,
        ];
    }
}
